{-# 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.AssociateQualificationWithWorker
(
associateQualificationWithWorker
, AssociateQualificationWithWorker
, aqwwIntegerValue
, aqwwSendNotification
, aqwwQualificationTypeId
, aqwwWorkerId
, associateQualificationWithWorkerResponse
, AssociateQualificationWithWorkerResponse
, aqwwrsResponseStatus
) 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 AssociateQualificationWithWorker = AssociateQualificationWithWorker'
{ _aqwwIntegerValue :: !(Maybe Int)
, _aqwwSendNotification :: !(Maybe Bool)
, _aqwwQualificationTypeId :: !Text
, _aqwwWorkerId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateQualificationWithWorker
:: Text
-> Text
-> AssociateQualificationWithWorker
associateQualificationWithWorker pQualificationTypeId_ pWorkerId_ =
AssociateQualificationWithWorker'
{ _aqwwIntegerValue = Nothing
, _aqwwSendNotification = Nothing
, _aqwwQualificationTypeId = pQualificationTypeId_
, _aqwwWorkerId = pWorkerId_
}
aqwwIntegerValue :: Lens' AssociateQualificationWithWorker (Maybe Int)
aqwwIntegerValue = lens _aqwwIntegerValue (\ s a -> s{_aqwwIntegerValue = a})
aqwwSendNotification :: Lens' AssociateQualificationWithWorker (Maybe Bool)
aqwwSendNotification = lens _aqwwSendNotification (\ s a -> s{_aqwwSendNotification = a})
aqwwQualificationTypeId :: Lens' AssociateQualificationWithWorker Text
aqwwQualificationTypeId = lens _aqwwQualificationTypeId (\ s a -> s{_aqwwQualificationTypeId = a})
aqwwWorkerId :: Lens' AssociateQualificationWithWorker Text
aqwwWorkerId = lens _aqwwWorkerId (\ s a -> s{_aqwwWorkerId = a})
instance AWSRequest AssociateQualificationWithWorker
where
type Rs AssociateQualificationWithWorker =
AssociateQualificationWithWorkerResponse
request = postJSON mechanicalTurk
response
= receiveEmpty
(\ s h x ->
AssociateQualificationWithWorkerResponse' <$>
(pure (fromEnum s)))
instance Hashable AssociateQualificationWithWorker
where
instance NFData AssociateQualificationWithWorker
where
instance ToHeaders AssociateQualificationWithWorker
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("MTurkRequesterServiceV20170117.AssociateQualificationWithWorker"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AssociateQualificationWithWorker
where
toJSON AssociateQualificationWithWorker'{..}
= object
(catMaybes
[("IntegerValue" .=) <$> _aqwwIntegerValue,
("SendNotification" .=) <$> _aqwwSendNotification,
Just
("QualificationTypeId" .= _aqwwQualificationTypeId),
Just ("WorkerId" .= _aqwwWorkerId)])
instance ToPath AssociateQualificationWithWorker
where
toPath = const "/"
instance ToQuery AssociateQualificationWithWorker
where
toQuery = const mempty
newtype AssociateQualificationWithWorkerResponse = AssociateQualificationWithWorkerResponse'
{ _aqwwrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateQualificationWithWorkerResponse
:: Int
-> AssociateQualificationWithWorkerResponse
associateQualificationWithWorkerResponse pResponseStatus_ =
AssociateQualificationWithWorkerResponse'
{_aqwwrsResponseStatus = pResponseStatus_}
aqwwrsResponseStatus :: Lens' AssociateQualificationWithWorkerResponse Int
aqwwrsResponseStatus = lens _aqwwrsResponseStatus (\ s a -> s{_aqwwrsResponseStatus = a})
instance NFData
AssociateQualificationWithWorkerResponse
where