{-# 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.MechanicalTurk.SendTestEventNotification
(
sendTestEventNotification
, SendTestEventNotification
, stenNotification
, stenTestEventType
, sendTestEventNotificationResponse
, SendTestEventNotificationResponse
, stenrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.MechanicalTurk.Types
import Network.AWS.MechanicalTurk.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data SendTestEventNotification = SendTestEventNotification'
{ _stenNotification :: !NotificationSpecification
, _stenTestEventType :: !EventType
} deriving (Eq, Read, Show, Data, Typeable, Generic)
sendTestEventNotification
:: NotificationSpecification
-> EventType
-> SendTestEventNotification
sendTestEventNotification pNotification_ pTestEventType_ =
SendTestEventNotification'
{_stenNotification = pNotification_, _stenTestEventType = pTestEventType_}
stenNotification :: Lens' SendTestEventNotification NotificationSpecification
stenNotification = lens _stenNotification (\ s a -> s{_stenNotification = a})
stenTestEventType :: Lens' SendTestEventNotification EventType
stenTestEventType = lens _stenTestEventType (\ s a -> s{_stenTestEventType = a})
instance AWSRequest SendTestEventNotification where
type Rs SendTestEventNotification =
SendTestEventNotificationResponse
request = postJSON mechanicalTurk
response
= receiveEmpty
(\ s h x ->
SendTestEventNotificationResponse' <$>
(pure (fromEnum s)))
instance Hashable SendTestEventNotification where
instance NFData SendTestEventNotification where
instance ToHeaders SendTestEventNotification where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("MTurkRequesterServiceV20170117.SendTestEventNotification"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON SendTestEventNotification where
toJSON SendTestEventNotification'{..}
= object
(catMaybes
[Just ("Notification" .= _stenNotification),
Just ("TestEventType" .= _stenTestEventType)])
instance ToPath SendTestEventNotification where
toPath = const "/"
instance ToQuery SendTestEventNotification where
toQuery = const mempty
newtype SendTestEventNotificationResponse = SendTestEventNotificationResponse'
{ _stenrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
sendTestEventNotificationResponse
:: Int
-> SendTestEventNotificationResponse
sendTestEventNotificationResponse pResponseStatus_ =
SendTestEventNotificationResponse' {_stenrsResponseStatus = pResponseStatus_}
stenrsResponseStatus :: Lens' SendTestEventNotificationResponse Int
stenrsResponseStatus = lens _stenrsResponseStatus (\ s a -> s{_stenrsResponseStatus = a})
instance NFData SendTestEventNotificationResponse
where