{-# 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.Connect.StopContact
(
stopContact
, StopContact
, scContactId
, scInstanceId
, stopContactResponse
, StopContactResponse
, scrsResponseStatus
) where
import Network.AWS.Connect.Types
import Network.AWS.Connect.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data StopContact = StopContact'
{ _scContactId :: !Text
, _scInstanceId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopContact
:: Text
-> Text
-> StopContact
stopContact pContactId_ pInstanceId_ =
StopContact' {_scContactId = pContactId_, _scInstanceId = pInstanceId_}
scContactId :: Lens' StopContact Text
scContactId = lens _scContactId (\ s a -> s{_scContactId = a})
scInstanceId :: Lens' StopContact Text
scInstanceId = lens _scInstanceId (\ s a -> s{_scInstanceId = a})
instance AWSRequest StopContact where
type Rs StopContact = StopContactResponse
request = postJSON connect
response
= receiveEmpty
(\ s h x ->
StopContactResponse' <$> (pure (fromEnum s)))
instance Hashable StopContact where
instance NFData StopContact where
instance ToHeaders StopContact where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StopContact where
toJSON StopContact'{..}
= object
(catMaybes
[Just ("ContactId" .= _scContactId),
Just ("InstanceId" .= _scInstanceId)])
instance ToPath StopContact where
toPath = const "/contact/stop"
instance ToQuery StopContact where
toQuery = const mempty
newtype StopContactResponse = StopContactResponse'
{ _scrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopContactResponse
:: Int
-> StopContactResponse
stopContactResponse pResponseStatus_ =
StopContactResponse' {_scrsResponseStatus = pResponseStatus_}
scrsResponseStatus :: Lens' StopContactResponse Int
scrsResponseStatus = lens _scrsResponseStatus (\ s a -> s{_scrsResponseStatus = a})
instance NFData StopContactResponse where