{-# 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.ListReviewPolicyResultsForHIT
(
listReviewPolicyResultsForHIT
, ListReviewPolicyResultsForHIT
, lrprfhitRetrieveResults
, lrprfhitPolicyLevels
, lrprfhitRetrieveActions
, lrprfhitNextToken
, lrprfhitMaxResults
, lrprfhitHITId
, listReviewPolicyResultsForHITResponse
, ListReviewPolicyResultsForHITResponse
, lrprfhitrsHITReviewPolicy
, lrprfhitrsHITReviewReport
, lrprfhitrsNextToken
, lrprfhitrsAssignmentReviewReport
, lrprfhitrsHITId
, lrprfhitrsAssignmentReviewPolicy
, lrprfhitrsResponseStatus
) 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 ListReviewPolicyResultsForHIT = ListReviewPolicyResultsForHIT'
{ _lrprfhitRetrieveResults :: !(Maybe Bool)
, _lrprfhitPolicyLevels :: !(Maybe [ReviewPolicyLevel])
, _lrprfhitRetrieveActions :: !(Maybe Bool)
, _lrprfhitNextToken :: !(Maybe Text)
, _lrprfhitMaxResults :: !(Maybe Nat)
, _lrprfhitHITId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listReviewPolicyResultsForHIT
:: Text
-> ListReviewPolicyResultsForHIT
listReviewPolicyResultsForHIT pHITId_ =
ListReviewPolicyResultsForHIT'
{ _lrprfhitRetrieveResults = Nothing
, _lrprfhitPolicyLevels = Nothing
, _lrprfhitRetrieveActions = Nothing
, _lrprfhitNextToken = Nothing
, _lrprfhitMaxResults = Nothing
, _lrprfhitHITId = pHITId_
}
lrprfhitRetrieveResults :: Lens' ListReviewPolicyResultsForHIT (Maybe Bool)
lrprfhitRetrieveResults = lens _lrprfhitRetrieveResults (\ s a -> s{_lrprfhitRetrieveResults = a})
lrprfhitPolicyLevels :: Lens' ListReviewPolicyResultsForHIT [ReviewPolicyLevel]
lrprfhitPolicyLevels = lens _lrprfhitPolicyLevels (\ s a -> s{_lrprfhitPolicyLevels = a}) . _Default . _Coerce
lrprfhitRetrieveActions :: Lens' ListReviewPolicyResultsForHIT (Maybe Bool)
lrprfhitRetrieveActions = lens _lrprfhitRetrieveActions (\ s a -> s{_lrprfhitRetrieveActions = a})
lrprfhitNextToken :: Lens' ListReviewPolicyResultsForHIT (Maybe Text)
lrprfhitNextToken = lens _lrprfhitNextToken (\ s a -> s{_lrprfhitNextToken = a})
lrprfhitMaxResults :: Lens' ListReviewPolicyResultsForHIT (Maybe Natural)
lrprfhitMaxResults = lens _lrprfhitMaxResults (\ s a -> s{_lrprfhitMaxResults = a}) . mapping _Nat
lrprfhitHITId :: Lens' ListReviewPolicyResultsForHIT Text
lrprfhitHITId = lens _lrprfhitHITId (\ s a -> s{_lrprfhitHITId = a})
instance AWSRequest ListReviewPolicyResultsForHIT
where
type Rs ListReviewPolicyResultsForHIT =
ListReviewPolicyResultsForHITResponse
request = postJSON mechanicalTurk
response
= receiveJSON
(\ s h x ->
ListReviewPolicyResultsForHITResponse' <$>
(x .?> "HITReviewPolicy") <*>
(x .?> "HITReviewReport")
<*> (x .?> "NextToken")
<*> (x .?> "AssignmentReviewReport")
<*> (x .?> "HITId")
<*> (x .?> "AssignmentReviewPolicy")
<*> (pure (fromEnum s)))
instance Hashable ListReviewPolicyResultsForHIT where
instance NFData ListReviewPolicyResultsForHIT where
instance ToHeaders ListReviewPolicyResultsForHIT
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("MTurkRequesterServiceV20170117.ListReviewPolicyResultsForHIT"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListReviewPolicyResultsForHIT where
toJSON ListReviewPolicyResultsForHIT'{..}
= object
(catMaybes
[("RetrieveResults" .=) <$> _lrprfhitRetrieveResults,
("PolicyLevels" .=) <$> _lrprfhitPolicyLevels,
("RetrieveActions" .=) <$> _lrprfhitRetrieveActions,
("NextToken" .=) <$> _lrprfhitNextToken,
("MaxResults" .=) <$> _lrprfhitMaxResults,
Just ("HITId" .= _lrprfhitHITId)])
instance ToPath ListReviewPolicyResultsForHIT where
toPath = const "/"
instance ToQuery ListReviewPolicyResultsForHIT where
toQuery = const mempty
data ListReviewPolicyResultsForHITResponse = ListReviewPolicyResultsForHITResponse'
{ _lrprfhitrsHITReviewPolicy :: !(Maybe ReviewPolicy)
, _lrprfhitrsHITReviewReport :: !(Maybe ReviewReport)
, _lrprfhitrsNextToken :: !(Maybe Text)
, _lrprfhitrsAssignmentReviewReport :: !(Maybe ReviewReport)
, _lrprfhitrsHITId :: !(Maybe Text)
, _lrprfhitrsAssignmentReviewPolicy :: !(Maybe ReviewPolicy)
, _lrprfhitrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listReviewPolicyResultsForHITResponse
:: Int
-> ListReviewPolicyResultsForHITResponse
listReviewPolicyResultsForHITResponse pResponseStatus_ =
ListReviewPolicyResultsForHITResponse'
{ _lrprfhitrsHITReviewPolicy = Nothing
, _lrprfhitrsHITReviewReport = Nothing
, _lrprfhitrsNextToken = Nothing
, _lrprfhitrsAssignmentReviewReport = Nothing
, _lrprfhitrsHITId = Nothing
, _lrprfhitrsAssignmentReviewPolicy = Nothing
, _lrprfhitrsResponseStatus = pResponseStatus_
}
lrprfhitrsHITReviewPolicy :: Lens' ListReviewPolicyResultsForHITResponse (Maybe ReviewPolicy)
lrprfhitrsHITReviewPolicy = lens _lrprfhitrsHITReviewPolicy (\ s a -> s{_lrprfhitrsHITReviewPolicy = a})
lrprfhitrsHITReviewReport :: Lens' ListReviewPolicyResultsForHITResponse (Maybe ReviewReport)
lrprfhitrsHITReviewReport = lens _lrprfhitrsHITReviewReport (\ s a -> s{_lrprfhitrsHITReviewReport = a})
lrprfhitrsNextToken :: Lens' ListReviewPolicyResultsForHITResponse (Maybe Text)
lrprfhitrsNextToken = lens _lrprfhitrsNextToken (\ s a -> s{_lrprfhitrsNextToken = a})
lrprfhitrsAssignmentReviewReport :: Lens' ListReviewPolicyResultsForHITResponse (Maybe ReviewReport)
lrprfhitrsAssignmentReviewReport = lens _lrprfhitrsAssignmentReviewReport (\ s a -> s{_lrprfhitrsAssignmentReviewReport = a})
lrprfhitrsHITId :: Lens' ListReviewPolicyResultsForHITResponse (Maybe Text)
lrprfhitrsHITId = lens _lrprfhitrsHITId (\ s a -> s{_lrprfhitrsHITId = a})
lrprfhitrsAssignmentReviewPolicy :: Lens' ListReviewPolicyResultsForHITResponse (Maybe ReviewPolicy)
lrprfhitrsAssignmentReviewPolicy = lens _lrprfhitrsAssignmentReviewPolicy (\ s a -> s{_lrprfhitrsAssignmentReviewPolicy = a})
lrprfhitrsResponseStatus :: Lens' ListReviewPolicyResultsForHITResponse Int
lrprfhitrsResponseStatus = lens _lrprfhitrsResponseStatus (\ s a -> s{_lrprfhitrsResponseStatus = a})
instance NFData ListReviewPolicyResultsForHITResponse
where