{-# 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.DisassociateQualificationFromWorker
(
disassociateQualificationFromWorker
, DisassociateQualificationFromWorker
, dqfwReason
, dqfwWorkerId
, dqfwQualificationTypeId
, disassociateQualificationFromWorkerResponse
, DisassociateQualificationFromWorkerResponse
, dqfwrsResponseStatus
) 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 DisassociateQualificationFromWorker = DisassociateQualificationFromWorker'
{ _dqfwReason :: !(Maybe Text)
, _dqfwWorkerId :: !Text
, _dqfwQualificationTypeId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
disassociateQualificationFromWorker
:: Text
-> Text
-> DisassociateQualificationFromWorker
disassociateQualificationFromWorker pWorkerId_ pQualificationTypeId_ =
DisassociateQualificationFromWorker'
{ _dqfwReason = Nothing
, _dqfwWorkerId = pWorkerId_
, _dqfwQualificationTypeId = pQualificationTypeId_
}
dqfwReason :: Lens' DisassociateQualificationFromWorker (Maybe Text)
dqfwReason = lens _dqfwReason (\ s a -> s{_dqfwReason = a})
dqfwWorkerId :: Lens' DisassociateQualificationFromWorker Text
dqfwWorkerId = lens _dqfwWorkerId (\ s a -> s{_dqfwWorkerId = a})
dqfwQualificationTypeId :: Lens' DisassociateQualificationFromWorker Text
dqfwQualificationTypeId = lens _dqfwQualificationTypeId (\ s a -> s{_dqfwQualificationTypeId = a})
instance AWSRequest
DisassociateQualificationFromWorker
where
type Rs DisassociateQualificationFromWorker =
DisassociateQualificationFromWorkerResponse
request = postJSON mechanicalTurk
response
= receiveEmpty
(\ s h x ->
DisassociateQualificationFromWorkerResponse' <$>
(pure (fromEnum s)))
instance Hashable DisassociateQualificationFromWorker
where
instance NFData DisassociateQualificationFromWorker
where
instance ToHeaders
DisassociateQualificationFromWorker
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("MTurkRequesterServiceV20170117.DisassociateQualificationFromWorker"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DisassociateQualificationFromWorker
where
toJSON DisassociateQualificationFromWorker'{..}
= object
(catMaybes
[("Reason" .=) <$> _dqfwReason,
Just ("WorkerId" .= _dqfwWorkerId),
Just
("QualificationTypeId" .= _dqfwQualificationTypeId)])
instance ToPath DisassociateQualificationFromWorker
where
toPath = const "/"
instance ToQuery DisassociateQualificationFromWorker
where
toQuery = const mempty
newtype DisassociateQualificationFromWorkerResponse = DisassociateQualificationFromWorkerResponse'
{ _dqfwrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
disassociateQualificationFromWorkerResponse
:: Int
-> DisassociateQualificationFromWorkerResponse
disassociateQualificationFromWorkerResponse pResponseStatus_ =
DisassociateQualificationFromWorkerResponse'
{_dqfwrsResponseStatus = pResponseStatus_}
dqfwrsResponseStatus :: Lens' DisassociateQualificationFromWorkerResponse Int
dqfwrsResponseStatus = lens _dqfwrsResponseStatus (\ s a -> s{_dqfwrsResponseStatus = a})
instance NFData
DisassociateQualificationFromWorkerResponse
where